import { useState } from 'react'
import { Select, SelectProps } from 'antd'

interface TransportSelectProps extends SelectProps {
  value?: string
  onChange?: (value?: string) => void
}
export const TransportSelect = ({ value, onChange, ...rest }: TransportSelectProps) => {
  const [selectedValue, setSelectedValue] = useState(value)

  return (
    <div>
      <Select
        style={{ width: 100 }}
        {...rest}
        value={selectedValue}
        onChange={v => {
          setSelectedValue(v)
          onChange?.(v)
        }}
      />
    </div>
  )
}
